# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Language.V1.Model.XPSTablesClassificationMetricsCurveMetrics do
  @moduledoc """
  Metrics curve data point for a single value.

  ## Attributes

  *   `aucPr` (*type:* `float()`, *default:* `nil`) - The area under the precision-recall curve.
  *   `aucRoc` (*type:* `float()`, *default:* `nil`) - The area under receiver operating characteristic curve.
  *   `confidenceMetricsEntries` (*type:* `list(GoogleApi.Language.V1.Model.XPSTablesConfidenceMetricsEntry.t)`, *default:* `nil`) - Metrics that have confidence thresholds. Precision-recall curve and ROC curve can be derived from them.
  *   `logLoss` (*type:* `float()`, *default:* `nil`) - The Log loss metric.
  *   `positionThreshold` (*type:* `integer()`, *default:* `nil`) - The position threshold value used to compute the metrics.
  *   `value` (*type:* `String.t`, *default:* `nil`) - The CATEGORY row value (for ARRAY unnested) the curve metrics are for.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :aucPr => float() | nil,
          :aucRoc => float() | nil,
          :confidenceMetricsEntries =>
            list(GoogleApi.Language.V1.Model.XPSTablesConfidenceMetricsEntry.t()) | nil,
          :logLoss => float() | nil,
          :positionThreshold => integer() | nil,
          :value => String.t() | nil
        }

  field(:aucPr)
  field(:aucRoc)

  field(:confidenceMetricsEntries,
    as: GoogleApi.Language.V1.Model.XPSTablesConfidenceMetricsEntry,
    type: :list
  )

  field(:logLoss)
  field(:positionThreshold)
  field(:value)
end

defimpl Poison.Decoder,
  for: GoogleApi.Language.V1.Model.XPSTablesClassificationMetricsCurveMetrics do
  def decode(value, options) do
    GoogleApi.Language.V1.Model.XPSTablesClassificationMetricsCurveMetrics.decode(value, options)
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.Language.V1.Model.XPSTablesClassificationMetricsCurveMetrics do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
